#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() 
{
    int a,arr[3];
    while (scanf("%d", &a) != EOF) 
    {
        for (int i=0;i<4;i++)
        {
         arr[i] = a % 10;
         a /= 10;
        }
        for (int i = 0; i < 4; i++)
        {
          printf("%d",arr[i]);
        }
    }
    return 0;
}